package com.lagou.config;

import com.alibaba.druid.pool.DruidDataSource;
import com.lagou.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.*;

import javax.sql.DataSource;

/**
 * spring纯注解实现IOC
 */
@Configuration
@ComponentScan({"com.lagou"})
/*@PropertySource({"classpath:jdbc.propertites"})*/
@Import(BeanFactory.class)
public class SpringConfig {

    /*@Value("${jdbc.driverClassName}")
    private String driverClassName;
    @Value("${jdbc.url}")
    private String url;
    @Value("${jdbc.username}")
    private String username;
    @Value("${jdbc.password}")
    private String password;*/

    /*@Bean("dataSource")
    public DataSource createDateSource(){
        DruidDataSource dataSource=new DruidDataSource();
        dataSource.setDriverClassName(driverClassName);
        dataSource.setUrl(url);
        dataSource.setUsername(username);
        dataSource.setPassword(password);
        return dataSource;
    }*/


}
